package com.doudou.collection.controller;


import com.doudou.collection.response.ResultVO;
import com.doudou.collection.service.UserDetailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 个人信息模块
 */
@Api(tags = "03.用户管理模块")
@Slf4j
@RestController
@RequestMapping("/v1/userdetail")
public class UserDetailController {

    @Autowired
    UserDetailService userDetailService;

    @ApiOperation("个人粉丝数")
    @GetMapping("/{id}/fans")
    public ResultVO selectFans(@PathVariable Long id) {
        log.debug("查询当前用户粉丝数, {}", id);

        return userDetailService.selectFansCountById(id);
    }

    @ApiOperation("个人粉丝列表")
    @GetMapping("/{id}/fanslist")
    public ResultVO selectFansList(@PathVariable Long id) {
        log.debug("查询当前用户粉丝列表, {}", id);

        return userDetailService.selectFansListById(id);
    }


    @ApiOperation("个人关注数")
    @GetMapping("/{id}/follows")
    public ResultVO selectFollows(@PathVariable Long id) {
        log.debug("查询当前用户关注数, {}", id);

        return userDetailService.selectFollowsCountById(id);
    }

    @ApiOperation("个人关注列表")
    @GetMapping("/{id}/followlist")
    public ResultVO selectFollowList(@PathVariable Long id) {
        log.debug("查询当前用户关注列表, {}", id);

        return userDetailService.selectFollowListById(id);
    }


}
